// townscript for town 2: remote hut

begintownscript;

variables;

int i,j,choice;

body;

beginstate INIT_STATE;
break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;
break;

beginstate 10;
if (get_flag(2,1) == 1)
		end();
	message_dialog("A big wave of energy gets hold of you when you stand at the stairs. It feels like you are pulled in. After the smoke slowly drifts into the main hall, you see a portal in front of you. Maybe this is the way to Thralni.","");
	set_flag(2,1,1);
break;

beginstate 11;
	reset_dialog();
	add_dialog_str(0,"A big teleporter, very strong it seems, is humming in a pleasant way in front of you. You gather this is the teleporter which should teleport you to Thralni, wherever he is.",0);
	add_dialog_choice(0,"Enter it");
	add_dialog_choice(1,"Leave");
	choice = run_dialog(1);
	
	if (choice == 1) {
			put_boom_on_char(0,2,0);
			put_boom_on_char(1,2,0);
			put_boom_on_char(2,2,0);
			put_boom_on_char(3,2,0);
			put_boom_on_char(4,2,0);
			put_boom_on_char(5,2,0);
			run_animation_sound(10);
			run_animation();
			change_outdoor_location(4,2,19,9);
			move_to_new_town(37,13,15);
			}
break;


beginstate 12;
if (get_flag(2,2) == 1)
		end();
	message_dialog("You stand at the entrance to a corridor. It contains two barriers. You came here, assuming this was just some hut, made for a portal, but stumbled upon a small palace. You ask yourself what else you will find here.","");
	set_flag(2,2,1);
break;

beginstate 13;
if (get_flag(2,3) == 1)
		end();
	message_dialog("You don't believe your eyes! In this strange hut, you also find a throne room! Big pillars stand in the middle of the hall, and two beautiful chairs stand on some sort of heightening.","The hall is fabulous. You really don't understand what a throne room would do in this hut. After all, this was only the link to where Thralni is now, not the actual place where Thralni lived, or was it?");
	set_flag(2,3,1);
break;

beginstate 14;
	message_dialog("You find a book containing some interesting formulas. Soon you learn that its a spell book. One interesting thing gets to your attention: The unlock door spell. You memorise it well.","");
	j = get_selected_pc();
	i = 0;
	while (i < 4) {
		if (((j < 0) || (j == i)) && (char_ok(i))) {
			if (get_spell_level(i,0,7) == 0)
				change_spell_level(i,0,7,1);
			}
			i = i + 1;
		}
break;
	
	
	
beginstate 15;
if (get_flag(2,6) == 1)
		end();
	message_dialog("A big laboratory has been made in this tiny hut. A spell book stands in a corner. From here you can already see it doesn't contain anything useful, though.","");
	set_flag(2,6,1);
break;

beginstate 16;
if (get_flag(2,10) == 1)
		end();
	message_dialog("A nice little temple has been built here. And why not? If there is a laboratory, why not a place to pray?","Although a remote hut isn't really a place for something like this, it is something you eventually did expect, how strange it may seem. However, you didn't think of it being this large.");
	set_flag(2,10,1);
break;

beginstate 17;
if (get_flag(2,4) == 1)
		end();
	message_dialog("Apparently, the only thing this place misses is a loo and a kitchen. Now you find there is a small treasure room here. It would be worthwhile to just take a look to see what's in the boxes.","");
	set_flag(2,4,1);
break;